﻿@{
                /**/

                ViewBag.Title = "Index";
                Layout = "~/Views/Shared/_Index.cshtml";
}
<script>
    $(function () {
        gridList();
        $("#gridList").jqGrid('setLabel', 'rn', '序号', { 'text-align': 'center', 'vertical-align': 'middle' });
    })
    function gridList() {
        var $gridList = $("#gridList");
        var in_Year = $.request("Year");
        console.log(in_Year);
        $gridList.dataGrid({
            url: "/Gas/Statistics/GetGridJsonMonthDetails",
            height: $(window).height() - 96,
            colModel: [
                { label: "主键", name: "F_Id", hidden: true, key: true },
                { label: '姓名', name: 'RName', width: 50, align: 'left' },
                { label: '身份证号', name: 'IDNumber', width: 150, align: 'left' },
                { label: '就餐时间', name: 'RecordTime', width: 150, align: 'left' },
                { label: '满意度', name: 'Satisfaction', width: 150, align: 'left' },
                { label: '是否刷卡', name: 'Result', width: 150, align: 'left' },
            ],
            postData: { Year: in_Year, 'txtResult': $("#txtResult").val()},
            pager: "#gridPager",
            sortname: 'RecordTime desc',
            viewrecords: true
        });
        $("#btn_search").click(function () {
            $gridList.jqGrid('setGridParam', {
                postData: { RName: $("#txtRName").val(), IDNumber: $("#txtIDNumber").val(), txtResult: $("#txtResult").val() },
            }).trigger('reloadGrid');
        });
    }
</script>

<div class="topPanel">
    <div class="toolbar">
        <div class="btn-group">
            <a class="btn btn-primary" onclick="$.reload()"><span class="glyphicon glyphicon-refresh"></span></a>
        </div>
        <div class="btn-group">

        </div>
        <div class="operate">
            <ul class="nav nav-pills"></ul>
            <a href="javascript:;" class="close"></a>
        </div>
        <script>$('.toolbar').authorizeButton()</script>
    </div>
    <div class="search">
        <table>
            <tr>
                <td>
                    <div class="input-group">
                        <input id="txtRName" type="text" class="form-control" placeholder="姓名" style="width: 100px;">&nbsp;&nbsp;&nbsp;&nbsp;
                        <input id="txtIDNumber" type="text" class="form-control" placeholder="身份证号" style="width: 200px;">
                        <select id="txtResult" class="form-control" style="width:120px">
                            <option value="0" title="全部">全部</option>
                            <option value="已刷卡" title="已刷卡" selected>已刷卡</option>
                            <option value="未刷卡" title="未刷卡">未刷卡</option>
                        </select>
                        <span class="input-group-btn">
                            <button id="btn_search" type="button" class="btn  btn-primary"><i class="fa fa-search"></i></button>
                        </span>
                    </div>
                </td>
            </tr>
        </table>
    </div>
</div>
<div class="gridPanel">
    <table id="gridList"></table>
    <div id="gridPager"></div>
</div>
